<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新增项目</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: "Microsoft YaHei", sans-serif;
            background-color: #f5f5f5;
        }
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding-top: 60px;
        }
        .modal-content {
            width: 100%;
            max-width: 800px;
            background-color: #fff;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            position: relative;
        }
        .modal-header {
            padding: 16px 24px;
            border-bottom: 1px solid #f0f0f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-title {
            font-size: 16px;
            color: rgba(0, 0, 0, 0.85);
            font-weight: 500;
        }
        .modal-close {
            cursor: pointer;
            font-size: 18px;
            color: rgba(0, 0, 0, 0.45);
            background: none;
            border: none;
        }
        .modal-body {
            padding: 24px;
            max-height: 70vh;
            overflow-y: auto;
        }
        .form-section {
            margin-bottom: 24px;
        }
        .section-title {
            font-size: 14px;
            color: rgba(0, 0, 0, 0.85);
            margin-bottom: 16px;
            font-weight: 500;
        }
        .form-row {
            margin-bottom: 20px;
            display: flex;
            flex-wrap: wrap;
        }
        .form-group {
            flex: 1;
            min-width: 300px;
            margin-bottom: 16px;
            margin-right: 20px;
        }
        .form-label {
            margin-bottom: 8px;
            display: block;
            color: rgba(0, 0, 0, 0.85);
        }
        .required::before {
            content: '*';
            color: #ff4d4f;
            margin-right: 4px;
        }
        .form-control {
            width: 100%;
            height: 32px;
            padding: 4px 11px;
            border: 1px solid #d9d9d9;
            border-radius: 2px;
            transition: all 0.3s;
        }
        .form-control:focus {
            border-color: #40a9ff;
            outline: 0;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }
        .form-control.has-error {
            border-color: #ff4d4f;
        }
        .clear-btn {
            color: #999;
            position: absolute;
            right: 10px;
            top: 8px;
            cursor: pointer;
            display: none;
        }
        .input-with-clear {
            position: relative;
        }
        .input-with-clear input:focus + .clear-btn,
        .input-with-clear:hover .clear-btn {
            display: block;
        }
        .search-icon {
            position: absolute;
            right: 10px;
            top: 8px;
            cursor: pointer;
            color: #999;
        }
        .upload-section {
            border: 1px dashed #d9d9d9;
            border-radius: 2px;
            background-color: #fafafa;
            text-align: center;
            padding: 16px;
            cursor: pointer;
            margin-top: 16px;
        }
        .upload-icon {
            font-size: 24px;
            color: #999;
            margin-bottom: 8px;
        }
        .upload-text {
            color: #ff4d4f;
        }
        .modal-footer {
            padding: 10px 16px;
            text-align: center;
            border-top: 1px solid #f0f0f0;
        }
        .btn {
            padding: 8px 16px;
            margin: 0 8px;
            border: 1px solid #d9d9d9;
            border-radius: 2px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.3s;
        }
        .btn-default {
            background-color: #fff;
            color: rgba(0, 0, 0, 0.65);
        }
        .btn-primary {
            background-color: #1890ff;
            border-color: #1890ff;
            color: #fff;
        }
        .btn-primary:hover {
            background-color: #40a9ff;
            border-color: #40a9ff;
        }
    </style>
</head>
<body>
    <div class="modal">
        <div class="modal-content">
            <div class="modal-header">
                <div class="modal-title">新增</div>
                <button class="modal-close" onclick="window.history.back()">×</button>
            </div>
            
            <div class="modal-body">
                <div class="form-section">
                    <div class="section-title">基本信息</div>
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label required">项目名称:</label>
                            <div class="input-with-clear">
                                <input type="text" class="form-control" required>
                                <span class="clear-btn">×</span>
                                <span class="search-icon">🔍</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label required">项目编号:</label>
                            <input type="text" class="form-control" required>
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label required">建设单位:</label>
                            <div class="input-with-clear">
                                <input type="text" class="form-control" required>
                                <span class="search-icon">🔍</span>
                            </div>
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label">项目类型:</label>
                            <input type="text" class="form-control">
                        </div>
                        
                        <div class="form-group">
                            <label class="form-label">投标金额:</label>
                            <input type="text" class="form-control">
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label">供应商:</label>
                            <input type="text" class="form-control">
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label">联系人:</label>
                            <input type="text" class="form-control">
                        </div>
                        
                        <div class="form-group">
                            <label class="form-label">联系方式:</label>
                            <input type="text" class="form-control">
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label">创建时间:</label>
                            <input type="text" class="form-control">
                        </div>
                    </div>
                </div>
                
                <div class="form-section">
                    <div class="section-title">
                        <span class="attachment-icon">📎</span> 附件
                    </div>
                    <div class="upload-section">
                        <div class="upload-icon">+</div>
                    </div>
                </div>
            </div>
            
            <div class="modal-footer">
                <button class="btn btn-default" onclick="window.history.back()">取消</button>
                <button class="btn btn-primary">确认提交</button>
                <button class="btn btn-default">保存</button>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 清除按钮功能
            const clearBtns = document.querySelectorAll('.clear-btn');
            clearBtns.forEach(btn => {
                btn.addEventListener('click', function(e) {
                    const input = e.target.previousElementSibling;
                    input.value = '';
                    input.focus();
                });
            });

            // 返回按钮功能
            document.querySelector('.modal-close').addEventListener('click', function() {
                window.location.href = '../join-bidding.html';
            });

            // 取消按钮功能
            document.querySelector('.btn-default').addEventListener('click', function() {
                window.location.href = '../join-bidding.html';
            });

            // 提交按钮功能
            document.querySelector('.btn-primary').addEventListener('click', function() {
                // 这里可以添加表单验证和提交逻辑
                alert('表单提交成功！');
                window.location.href = '../join-bidding.html';
            });
        });
    </script>
</body>
</html>
